/*
 * @Author: Vorga
 * @LastEditors: Vorga
 */
#ifndef CROSS_GRAPH_H
#define CROSS_GRAPH_H

typedef int (*CMP)(const void*, const void*);
typedef void (*FUNC)(const void*);

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

typedef struct CrossEdge {
    int in;
    int out;
    struct CrossEdge* in_next;
    struct CrossEdge* out_next;
    //void* info
} CrossEdge;

typedef struct CrossVertex {
    char vex;
    CrossEdge* head_in;
    CrossEdge* head_out;
} CrossVertex;

typedef struct CrossGraph {
    CrossVertex* vertex;
    size_t vexnum;
} CrossGraph;

int _get_cro_vex(CrossGraph* graph, char v);

CrossEdge* create_cro_eg(int in, int out);

CrossGraph* create_cro_gp(const char* str);

bool add_eg_cro_gp(CrossGraph* graph, char v1, char v2);

size_t vex_in_cro_gp(CrossGraph* graph, char v);

size_t vex_out_cro_gp(CrossGraph* graph, char v);

void traversal_cro_gp(CrossGraph* graph);

#endif // CROSS_GRAPH_H
